#include <stdio.h>
#include <unistd.h>
#include "ohos_init.h"
#include "los_tick.h"
VOID Example_GetTime(VOID)
{
UINT32 cyclePerTick;
UINT64 tickCount;
UINT32 ms;
UINT32 tick;
cyclePerTick = LOS_CyclePerTickGet();
if(0 != cyclePerTick) {
dprintf("LOS_CyclePerTickGet = %d \n", cyclePerTick);
}
tickCount = LOS_TickCountGet();
if(0 != tickCount) {
dprintf("LOS_TickCountGet = %d \n", (UINT32)tickCount);
}
LOS_TaskDelay(200);
tickCount = LOS_TickCountGet();
if(0 != tickCount) {
dprintf("LOS_TickCountGet after delay = %d \n", (UINT32)tickCount);
}

tick = LOS_MS2Tick(10000);// 10000ms转换为tick
dprintf("tick = %d \n", tick);
ms = LOS_Tick2MS(100); // 100tick转换为ms
dprintf("ms = %d \n", ms);
}
APP_FEATURE_INIT(Example_GetTime);